const { remote } = require('electron')

window.addEventListener('DOMContentLoaded', () => {
    const btn = document.getElementById('btn')

    btn.addEventListener('click', () => {
        let sonWin = new remote.BrowserWindow({
            with: 300,
            height: 300,
            autoHideMenuBar: true
        })

        sonWin.loadFile('new.html')

        sonWin.on('close', () => {
            sonWin = null
        })
    })
})